import request from '../utils/request'

export const getLunbo = () => {
  return request({
    method: 'get',
    url: '/api/getlunbo'
  })
}

export const getGrid = () => {
  return request({
    method: 'get',
    url: '/api/grids'
  })
}

export const getNewsList = () => {
  return request({
    method: 'get',
    url: '/api/getnewslist'
  })
}

export const getNewsInfo = id => {
  return request({
    method: 'get',
    url: '/api/getnew/' + id
  })
}

export const getComments = ({ id, pageNo, pageSize }) => {
  return request({
    method: 'get',
    url: `/api/getcomments/${id}?pageindex=${pageNo}&limit=${pageSize}`
  })
}

export const postComments = ({ id, content }) => {
  return request({
    method: 'post',
    url: `/api/postcomment/${id}`,
    data:{
      content
    }
  })
}

export const getImgCateGory = () => {
  return request({
    method: 'get',
    url: '/api/getimgcategory'
  })
}

export const getimages = id => {
  return request({
    method: 'get',
    url: '/api/getimages/' + id
  })
}

export const getThumImages = id => {
  return request({
    method: 'get',
    url: '/api/getthumimages/' + id
  })
}

export const getimageInfo = id => {
  return request({
    method: 'get',
    url: '/api/getimageInfo/' + id
  })
}

export const getGoods = ({ pageNo, pageSize }) => {
  return request({
    method: 'get',
    url: `/api/getgoods?pageindex=${pageNo}&limit=${pageSize}`
  })
}

export const getGoodsInfo = id => {
  return request({
    method: 'get',
    url: '/api/goods/getinfo/' + id
  })
}
